﻿CREATE TABLE [dbo].[HospMsgTemplateVar] (
    [Id]           INT            IDENTITY (1, 1) NOT NULL,
    [TemplateName] NVARCHAR (50)  NOT NULL,
    [Key]          NVARCHAR (50)  NOT NULL,
    [DisplayName]  NVARCHAR (50)  NOT NULL,
    [Description]  NVARCHAR (500) NULL,
    [Usage]        NVARCHAR (50)  NOT NULL,
    [RecStatus]    INT            NOT NULL,
    [RecCreateDt]  DATETIME       NOT NULL,
    [RecUpdateDt]  DATETIME       NULL,
    [RecDeleteDt]  DATETIME       NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'医院消息模版可用变量表', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'主键，自增长', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'Id';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'模版名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'TemplateName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'变量名称，（在模版内的写法，如 @(Model.ApptedDate)）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'Key';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'显示名称，如预约就诊日期', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'DisplayName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'变量说明', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'Description';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'作用域，取值范围： Hosp ， Dept , Dr', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'Usage';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录状态, 1：正常；2：删除', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'RecStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录创建时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'RecCreateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录上次修改时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'RecUpdateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录删除时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HospMsgTemplateVar', @level2type = N'COLUMN', @level2name = N'RecDeleteDt';

